#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time   : 2021/7/4 11:39
# @Author : cjw
import allure

from app_wework_po.base.base_page import BasePage
from app_wework_po.setting import ELEMENT_YML
from app_wework_po.util.file_operator import YmlOperator
from app_wework_po.util.log import logger


class PersonInformationPage(BasePage):
    """个人信息页面"""

    # 添加元素定位数据到locators
    BasePage.locators.update(YmlOperator(ELEMENT_YML['pig']).data)

    def goto_person_setting(self):
        """跳转到个人设置页面"""
        from app_wework_po.page.person_setting_page import PersonSettingPage

        with allure.step(msg := f'点击右上角的“⋮”, 跳转到个人设置页面'):
            logger.info(msg)
            self.tap(self.btn_setting)
        return PersonSettingPage(self.driver)
